// 文件路径: com.city.java.reports.pojo.entity.ReportProcessing.java
package com.city.java.reports.pojo.entity;

import lombok.Data;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 举报处理实体类
 */
@Data
public class ReportProcessing {
    private Long processingId;
    private Long reportId;
    private String processingResult;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime processedAt;

    private ProcessingStatus status;

    /**
     * 处理状态枚举 - 对应数据库 ENUM('pending', 'processed')
     */
    public enum ProcessingStatus {
        pending("pending"),
        processed("processed");

        private final String value;

        ProcessingStatus(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }

        public static ProcessingStatus fromValue(String value) {
            for (ProcessingStatus status : values()) {
                if (status.value.equalsIgnoreCase(value)) {
                    return status;
                }
            }
            throw new IllegalArgumentException("Invalid processing status: " + value);
        }

        @Override
        public String toString() {
            return this.value;
        }
    }
}
